<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="color-scheme" content="light dark">
    <title>  </title>
  </head>
  <body>
    <div id="app"></div>
    <script type="module" src="/src/main.ts"></script>
    <script>
        const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)')

        function darkModeHandler() {
            if (mediaQuery.matches) {
                console.log('现在是深色模式')
            } else {
                console.log('现在是浅色模式')
            }
        }
        // 判断当前模式
        darkModeHandler()
        // 监听模式变化
        mediaQuery.addListener(darkModeHandler)
    </script>
  </body>
</html>
